# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=cantor
pkgver=23.08.4
pkgrel=0
# armhf blocked by extra-cmake-modules
# ppc64le, s390x and riscv64 blocked by qt5-qtwebengine
arch="all !armhf !s390x !riscv64 !ppc64le"
url="https://edu.kde.org/cantor/"
pkgdesc="KDE Frontend to Mathematical Software "
license="GPL-2.0-or-later"
makedepends="
	analitza-dev
	extra-cmake-modules
	karchive5-dev
	kcompletion5-dev
	kconfig5-dev
	kcoreaddons5-dev
	kcrash5-dev
	kdoctools5-dev
	ki18n5-dev
	kiconthemes5-dev
	kio5-dev
	knewstuff5-dev
	kparts5-dev
	kpty5-dev
	ktexteditor5-dev
	ktextwidgets5-dev
	kxmlgui5-dev
	poppler-qt5-dev
	python3-dev
	qt5-qtbase-dev
	qt5-qtsvg-dev
	qt5-qtwebengine-dev
	qt5-qtxmlpatterns-dev
	samurai
	syntax-highlighting5-dev
	"
checkdepends="xvfb-run"
_repo_url="https://invent.kde.org/education/cantor.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/cantor-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
fa829a9260164d596fa9383a109a37da1f669d0ffb43292fb32ba36a12144f7e532f78fff65cf50b7805b9325163733d3df195404ee0f2618a06d9874a1641d6  cantor-23.08.4.tar.xz
"
